home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1997
/
HAM Radio 1997.iso
/
vcls
/
moden
/
adprotcl.int
< prev
next >
Wrap
Text File
|
1996-04-08
|
30KB
|
767 lines
{Conditional defines that may affect this unit}
{$I AWDEFINE.INC}
{Required options}
{$I+,G+,X+,F+,V-} {!!.01}
{$C MOVEABLE,DEMANDLOAD,DISCARDABLE}
{*********************************************************}
{* ADPROTCL.PAS 1.01 *}
{* Copyright (c) TurboPower Software 1995 *}
{* All rights reserved. *}
{*********************************************************}
unit AdProtcl;
{-File transfer protocol VCL component}
interface
uses
{!!.01 modified}
{-----RTL}
WinTypes,
WinProcs,
SysUtils,
Classes,
Messages,
Controls,
DsgnIntf,
Graphics,
Forms,
{-----APD}
OoMisc,
{$IFNDEF UseAPWDLL}
AwUser,
AwAbsPcl,
AwXmodem,
AwYmodem,
AwZmodem,
AwKermit,
AwBPlus,
AwAscii,
AdMisc,
{$ENDIF}
AdExcept,
AdPort;
{$IFNDEF UseAPWDLL}
{$R APWP.RES}
{$ENDIF}
{$IFDEF UseAPWDLL}
{$I AWABSPCL.PA0} {Abstract procedure/function declarations}
{$I AWXMODEM.PA0} {Xmodem procedure/function declarations}
{$I AWYMODEM.PA0} {Ymodem procedure/function declarations}
{$I AWZMODEM.PA0} {Zmodem procedure/function declarations}
{$I AWKERMIT.PA0} {Kermit procedure/function declarations}
{$I AWBPLUS.PA0} {B+ procedure/function declarations}
{$I AWASCII.PA0} {ASCII procedure/function declarations}
{$ENDIF}
type
{Block check methods - NOTE! this must match OOMISC}
TBlockCheckMethod = (
bcmNone,
bcmChecksum,
bcmChecksum2,
bcmCrc16,
bcmCrc32,
bcmCrcK);
{Protocol types - NOTE! this must match OOMISC}
TProtocolType = (
ptNoProtocol,
ptXmodem,
ptXmodemCRC,
ptXmodem1K,
ptXmodem1KG,
ptYmodem,
ptYmodemG,
ptZmodem,
ptKermit,
ptAscii,
ptBPlus);
{Zmodem file management options - NOTE! this must match OOMISC}
TZmodemFileOptions = (
zfoNoOption, {Place holder}
zfoWriteNewerLonger, {Transfer if new, newer or longer}
zfoWriteCrc, {Not supported, same as WriteNewer}
zfoWriteAppend, {Transfer if new, append if exists}
zfoWriteClobber, {Transfer regardless}
zfoWriteNewer, {Transfer if new or newer}
zfoWriteDifferent, {Transfer if new or diff dates/lens}
zfoWriteProtect); {Transfer only if new}
{Action to take if incoming file exists - NOTE! this must match OOMISC}
TWriteFailAction = (
wfWriteNone, {No option set yet}
wfWriteFail, {Fail the open attempt}
wfWriteRename, {Rename the incoming file}
wfWriteAnyway, {Overwrite the existing file}
wfWriteResume); {Resume an interrupted receive}
{ASCII end-of-line translations}
TAsciiEOLTranslation = (
aetNone, {No CR/LF translations}
aetStrip, {Strip CRs or LFs}
aetAddCRBefore, {Add CR before each LF}
aetAddLFAfter); {Add LF after each CR}
{Dispatcher modes}
TDispatcherMode = (
dNone, {Failed to enable dispatcher}
dTimer, {Use the timer only}
dCommEvents, {Use 3.1 style comm events and a timer}
dAuto); {Use dCommEvents for 3.1, dTimer for 3.0}
{DeleteFailed options for TApdProtocolLog} {!!.01}
TDeleteFailed = (dfNever, dfAlways, dfNonRecoverable); {!!.01}
const
{Defaults for TApdProtocol properties}
DefProtocolType = ptZmodem;
DefXYmodemBlockWait = 91;
DefZmodemOptionOverride = False;
DefZmodemSkipNoFile = False;
DefZmodemFileOption = zfoWriteNewer;
DefZmodemRecover = False;
DefZmodem8K = False;
DefZmodemFinishRetry = 0;
DefKermitMaxLen = 80;
DefKermitMaxWindows = 0;
DefKermitSWCTurnDelay = 0;
DefKermitTimeoutSecs = 5;
DefKermitPadCharacter = ' ';
DefKermitPadCount = 0;
DefKermitTerminator = #13;
DefKermitCtlPrefix = '#';
DefKermitHighbitPrefix = 'Y';
DefKermitRepeatPrefix = '~';
DefAsciiCharDelay = 0;
DefAsciiLineDelay = 0;
DefAsciiEOLChar = #13;
DefAsciiCRTranslation = aetNone;
DefAsciiLFTranslation = aetNone;
DefAsciiEOFTimeout = 364; {20 seconds}
DefHonorDirectory = False;
DefIncludeDirectory = False;
DefRTSLowForWrite = False;
DefAbortNoCarrier = False;
DefBP2KTransmit = False;
DefAsciiSuppressCtrlZ = False;
DefFinishWait = 364;
DefTurnDelay = 0;
DefOverhead = 0;
DefWriteFailAction = wfWriteRename;
DefStatusInterval = 18;
{Defaults for TApdProtocolLog properties}
DefHistoryName = 'APD.HIS';
DefDeleteFailed = dfNonRecoverable; {!!.01}
MaxKermitLongLen = 1024;
MaxKermitWindows = 27;
{Status options}
apFirstCall = OOMISC.apFirstCall;
apLastCall = OOMISC.apLastCall;
{General protocol status constants}
psOK = OOMISC.psOK;
psProtocolHandshake = OOMISC.psProtocolHandshake;
psInvalidDate = OOMISC.psInvalidDate;
psFileRejected = OOMISC.psFileRejected;
psFileRenamed = OOMISC.psFileRenamed;
psSkipFile = OOMISC.psSkipFile;
psFileDoesntExist = OOMISC.psFileDoesntExist;
psCantWriteFile = OOMISC.psCantWriteFile;
psTimeout = OOMISC.psTimeout;
psBlockCheckError = OOMISC.psBlockCheckError;
psLongPacket = OOMISC.psLongPacket;
psDuplicateBlock = OOMISC.psDuplicateBlock;
psProtocolError = OOMISC.psProtocolError;
psCancelRequested = OOMISC.psCancelRequested;
psEndFile = OOMISC.psEndFile;
psResumeBad = OOMISC.psResumeBad;
psSequenceError = OOMISC.psSequenceError;
psAbortNoCarrier = OOMISC.psAbortNoCarrier;
{Specific to certain protocols}
psGotCrcE = OOMISC.psGotCrcE;
psGotCrcG = OOMISC.psGotCrcG;
psGotCrcW = OOMISC.psGotCrcW;
psGotCrcQ = OOMISC.psGotCrcQ;
psTryResume = OOMISC.psTryResume;
psHostResume = OOMISC.psHostResume;
psWaitAck = OOMISC.psWaitAck;
{For specifying log file calls}
lfReceiveStart = OOMISC.lfReceiveStart;
lfReceiveOk = OOMISC.lfReceiveOk;
lfReceiveFail = OOMISC.lfReceiveFail;
lfReceiveSkip = OOMISC.lfReceiveSkip;
lfTransmitStart = OOMISC.lfTransmitStart;
lfTransmitOk = OOMISC.lfTransmitOk;
lfTransmitFail = OOMISC.lfTransmitFail;
lfTransmitSkip = OOMISC.lfTransmitSkip;
type
TApdCustomProtocol = class;
TApdProtocol = class;
{Protocol event handlers}
TProtocolAcceptEvent = procedure(CP : TObject;
var Accept : Boolean;
var FName : String) of object;
TProtocolErrorEvent = procedure(CP : TObject; ErrorCode : SmallInt)
of object;
TProtocolFinishEvent = procedure(CP : TObject; ErrorCode : SmallInt)
of object;
TProtocolLogEvent = procedure(CP : TObject; Log : Word)
of object;
TProtocolNextFileEvent = procedure(CP : TObject; var FName : String)
of object;
TProtocolResumeEvent = procedure(CP : TObject;
var Resume : TWriteFailAction)
of object;
TProtocolStatusEvent = procedure(CP : TObject; Options : Word)
of object;
{Abstract protocol status class}
TApdAbstractStatus = class(TComponent)
protected {private}
{.Z+}
FDisplay : TForm;
FPosition : TPosition;
FCtl3D : Boolean;
FVisible : Boolean;
protected
FProtocol : TApdCustomProtocol;
procedure SetPosition(const NewPosition : TPosition);
procedure SetCtl3D(const NewCtl3D : Boolean);
procedure SetVisible(const NewVisible : Boolean);
procedure GetProperties;
procedure Show;
public
constructor Create(AOwner : TComponent); override;
{-Create a TApdAbstractStatus component}
destructor Destroy;
{-Destroy a TApdAbstractStatus component}
{.Z-}
procedure UpdateDisplay(First, Last : Boolean); virtual; abstract;
{-Update the status display with current data}
procedure CreateDisplay; dynamic; abstract;
{-Create the status display}
procedure DestroyDisplay; dynamic; abstract;
{-Destroy the status display}
property Display : TForm
read FDisplay write FDisplay;
property Protocol : TApdCustomProtocol
read FProtocol;
published
property Position : TPosition
read FPosition write SetPosition;
property Ctl3D : Boolean
read FCtl3D write SetCtl3D;
property Visible : Boolean
read FVisible write SetVisible;
end;
{Builtin log procedure}
TApdProtocolLog = class(TComponent)
protected {private}
{.Z+}
FDeleteFailed : TDeleteFailed; {!!.01}
FHistoryName : String;
FProtocol : TApdCustomProtocol;
public
constructor Create(AOwner : TComponent); override;
{-Create a TApdProtocolLog component}
{.Z-}
procedure UpdateLog(const Log : Word); virtual;
{-Add a log entry}
property Protocol : TApdCustomProtocol
read FProtocol;
published
property DeleteFailed : TDeleteFailed {!!.01}
read FDeleteFailed write FDeleteFailed default DefDeleteFailed; {!!.01}
property HistoryName : String
read FHistoryName write FHistoryName;
end;
{Protocol component}
TApdCustomProtocol = class(TComponent)
protected {private}
{.Z+}
{Private data}
PData : PProtocolData; {Protocol data}
NeedBPS : Boolean; {True if we don't know BPS yet}
ProtFunc : TProtocolFunc; {Current protocol function}
Force : Boolean; {True to force setting options}
{Property data}
FMsgHandler : HWnd; {Window handler of MessageHandler}
FComPort : TApdCustomComPort; {Comport to use}
FProtocolType : TProtocolType; {Current protocol}
FStatusDisplay : TApdAbstractStatus; {Built-in status display}
FProtocolLog : TApdProtocolLog; {Built-in protocol logging function}
FXYmodemBlockWait : Word; {Inter-block delay in ticks}
FZmodemOptionOverride : Boolean; {True to override transmitter options}
FZmodemSkipNoFile : Boolean; {True to skip new incoming files}
FZmodemFileOption : TZmodemFileOptions; {File mgmt options}
FZmodemRecover : Boolean; {True to enable crash recovery}
FZmodem8K : Boolean; {True to enable 8K zmodem}
FZmodemFinishRetry : Word; {Number of ZFin retries}
FKermitMaxLen : Word; {Max normal packet len}
FKermitMaxWindows : Word; {Maximum number of windows}
FKermitSWCTurnDelay : Word; {Turn delay when SWC in use}
FKermitTimeoutSecs : Word; {Packet timeout in seconds}
FKermitPadCharacter : Char; {Pad character}
FKermitPadCount : Word; {Padding count}
FKermitTerminator : Char; {Packet terminator character (ASCII)}
FKermitCtlPrefix : Char; {Control char prefix (ASCII value)}
FKermitHighbitPrefix : Char; {Hibit prefix (ASCII value)}
FKermitRepeatPrefix : Char; {Repeat prefix (ASCII value)}
FAsciiCharDelay : Word; {Inter-character delay}
FAsciiLineDelay : Word; {Inter-line delay}
FAsciiEOLChar : Char; {End-of-line character (ASCII value)}
FAsciiCRTranslation : TAsciiEOLTranslation; {ASCII translate CR}
FAsciiLFTranslation : TAsciiEOLTranslation; {ASCII translate LF}
FAsciiEOFTimeout : Word; {Ticks to assume EOF}
{Events}
FOnProtocolAccept : TProtocolAcceptEvent;
FOnProtocolError : TProtocolErrorEvent;
FOnProtocolFinish : TProtocolFinishEvent;
FOnProtocolLog : TProtocolLogEvent;
FOnProtocolNextFile : TProtocolNextFileEvent;
FOnProtocolResume : TProtocolResumeEvent;
FOnProtocolStatus : TProtocolStatusEvent;
procedure CreateMessageHandler;
procedure CheckPort;
protected
{Misc protected methods}
procedure Notification(AComponent : TComponent; Operation: TOperation);
override;
{Property methods}
procedure SetComPort(const NewComPort : TApdCustomComPort);
procedure SetProtocolType(const NewProtocol : TProtocolType);
function GetDestinationDirectory : String;
procedure SetDestinationDirectory(const NewDir : String);
function GetFileMask : TFileName;
procedure SetFileMask(const NewFileMask : TFileName);
function GetBatch : Boolean;
function GetBlockCheckMethod : TBlockCheckMethod;
procedure SetBlockCheckMethod(const NewMethod : TBlockCheckMethod);
function GetHandshakeRetry : Word;
procedure SetHandshakeRetry(const NewRetry : Word);
function GetHandshakeWait : Word;
procedure SetHandshakeWait(const NewWait : Word);
function GetBlockLength : Word;
function GetBlockNumber : Word;
function GetTransmitTimeout : Word;
procedure SetTransmitTimeout(const NewTimeout : Word);
function GetFinishWait : Word;
procedure SetFinishWait(const NewWait : Word);
function GetActualBPS : LongInt;
procedure SetActualBPS(const NewBPS : Longint);
function GetTurnDelay : Word;
procedure SetTurnDelay(const NewDelay : Word);
function GetOverhead : Word;
procedure SetOverhead(const NewOverhead : Word);
function GetWriteFailAction : TWriteFailAction;
procedure SetWriteFailAction(const NewAction : TWriteFailAction);
function GetProtocolStatus : Word;
function GetProtocolError : SmallInt;
function GetFileLength : LongInt;
function GetFileDate : TDateTime;
function GetInitialPosition : LongInt;
function GetStatusInterval : Word;
procedure SetStatusInterval(const NewInterval : Word);
procedure SetStatusDisplay(const NewDisplay : TApdAbstractStatus);
procedure SetProtocolLog(const NewLog : TApdProtocolLog);
function GetInProgress : Boolean;
function GetBlockErrors : Word;
function GetTotalErrors : Word;
function GetBytesRemaining : LongInt;
function GetBytesTransferred : LongInt;
function GetElapsedTicks : LongInt;
function GetFileName : String;
procedure SetFileName(const NewName : String);
function GetXYmodemBlockWait : Word;
procedure SetXYmodemBlockWait(const NewWait : Word);
function GetZmodemOptionOverride : Boolean;
procedure SetZmodemOptionOverride(const NewOverride : Boolean);
function GetZmodemSkipNoFile : Boolean;
procedure SetZmodemSkipNoFile(const NewSkip : Boolean);
function GetZmodemFileOption : TZmodemFileOptions;
procedure SetZmodemFileOption(const NewOpt : TZmodemFileOptions);
function GetZmodemRecover : Boolean;
procedure SetZmodemRecover(const NewRecover : Boolean);
function GetZmodem8K : Boolean;
procedure SetZmodem8K(const New8K : Boolean);
function GetZmodemFinishRetry : Word;
procedure SetZmodemFinishRetry(const NewRetry : Word);
function GetKermitMaxLen : Word;
procedure SetKermitMaxLen(const NewLen : Word);
function GetKermitMaxWindows : Word;
procedure SetKermitMaxWindows(const NewMax : Word);
function GetKermitSWCTurnDelay : Word;
procedure SetKermitSWCTurnDelay(const NewDelay : Word);
function GetKermitTimeoutSecs : Word;
procedure SetKermitTimeoutSecs(const NewTimeout : Word);
function GetKermitPadCharacter : Char;
procedure SetKermitPadCharacter(NewChar : Char);
function GetKermitPadCount : Word;
procedure SetKermitPadCount(NewCount : Word);
function GetKermitTerminator : Char;
procedure SetKermitTerminator(const NewTerminator : Char);
function GetKermitCtlPrefix : Char;
procedure SetKermitCtlPrefix(const NewPrefix : Char);
function GetKermitHighbitPrefix : Char;
procedure SetKermitHighbitPrefix(const NewPrefix : Char);
function GetKermitRepeatPrefix : Char;
procedure SetKermitRepeatPrefix(const NewPrefix : Char);
function GetKermitWindowsTotal : Word;
function GetKermitWindowsUsed : Word;
function GetKermitLongBlocks : Boolean;
function GetAsciiCharDelay : Word;
procedure SetAsciiCharDelay(const NewDelay : Word);
function GetAsciiLineDelay : Word;
procedure SetAsciiLineDelay(const NewDelay : Word);
function GetAsciiEOLChar : Char;
procedure SetAsciiEOLChar(const NewChar : Char);
function GetAsciiCRTranslation : TAsciiEOLTranslation;
procedure SetAsciiCRTranslation(const NewTrans : TAsciiEOLTranslation);
function GetAsciiLFTranslation : TAsciiEOLTranslation;
procedure SetAsciiLFTranslation(const NewTrans : TAsciiEOLTranslation);
function GetAsciiEOFTimeout : Word;
procedure SetAsciiEOFTimeout(const NewTimeout : Word);
function GetHonorDirectory : Boolean;
procedure SetHonorDirectory(const NewOpt : Boolean);
function GetIncludeDirectory : Boolean;
procedure SetIncludeDirectory(const NewOpt : Boolean);
function GetRTSLowForWrite : Boolean;
procedure SetRTSLowForWrite(const NewOpt : Boolean);
function GetAbortNoCarrier : Boolean;
procedure SetAbortNoCarrier(const NewOpt : Boolean);
function GetBP2KTransmit : Boolean;
procedure SetBP2KTransmit(const NewOpt : Boolean);
function GetAsciiSuppressCtrlZ : Boolean;
procedure SetAsciiSuppressCtrlZ(const NewOpt : Boolean);
{Protocol event methods}
procedure apwProtocolAccept(CP : TObject; var Accept : Boolean;
var FName : String); virtual;
procedure apwProtocolError(CP : TObject; ErrorCode : SmallInt); virtual;
procedure apwProtocolFinish(CP : TObject; ErrorCode : SmallInt); virtual;
procedure apwProtocolLog(CP : TObject; Log : Word); virtual;
procedure apwProtocolNextFile(CP : TObject; var FName : String); virtual;
procedure apwProtocolResume(CP : TObject;
var Resume : TWriteFailAction); virtual;
procedure apwProtocolStatus(CP : TObject; Options : Word); virtual;
public
constructor Create(AOwner : TComponent); override;
{-Create a TApdProtocol component}
destructor Destroy; override;
{-Destroy a TApdProtocol component}
procedure Assign(Source : TPersistent); override;
{-Assign fields from TApdProtocol object specified by Source}
{.Z-}
function EstimateTransferSecs(const Size : Longint) : Longint;
{-Return the number of seconds to transmit Size bytes}
function StatusMsg(const Status : Word) : String;
{-Return a status message for Status}
procedure StartTransmit;
{-Start a background transmit session}
procedure StartReceive;
{-Start a background receive session}
procedure CancelProtocol;
{-Cancel the background protocol session}
{B+ methods}
procedure ProcessENQ;
{-Process the <ENQ> character for a B+ protocol}
procedure ProcessESCI(const X, Y : Byte);
{-Process the <ESC>I sequence for a B+ protocol}
procedure PrepareProcessDLE(var ATimerIndex : Word);
{-Prepare to process a <DLE> sequence for a B+ protocol}
procedure ProcessDLE(const IsData : Boolean;
var Ready, Start, Upload : Boolean);
{-Process a <DLE> sequence for a B+ protocol}
{General properties}
property ComPort : TApdCustomComPort
read FComPort write SetComPort;
{General protocol control properties}
property ProtocolType : TProtocolType
read FProtocolType write SetProtocolType; {default DefProtocolType;}{!!.01}
property DestinationDirectory : String
read GetDestinationDirectory write SetDestinationDirectory;
property FileMask : TFileName
read GetFileMask write SetFileMask;
property BlockCheckMethod : TBlockCheckMethod
read GetBlockCheckMethod write SetBlockCheckMethod;
property HandshakeRetry : Word
read GetHandshakeRetry write SetHandshakeRetry default DefHandshakeRetry;
property HandshakeWait : Word
read GetHandshakeWait write SetHandshakeWait default DefHandshakeWait;
property TransmitTimeout : Word
read GetTransmitTimeout write SetTransmitTimeout default DefTransTimeout;
property FinishWait : Word
read GetFinishWait write SetFinishWait default DefFinishWait;
property ActualBPS : Longint
read GetActualBPS write SetActualBPS;
property TurnDelay : Word
read GetTurnDelay write SetTurnDelay default DefTurnDelay;
property Overhead : Word
read GetOverhead write SetOverhead default DefOverhead;
property WriteFailAction : TWriteFailAction
read GetWriteFailAction write SetWriteFailAction
default DefWriteFailAction;
{Option properties}
property HonorDirectory : Boolean
read GetHonorDirectory write SetHonorDirectory
default DefHonorDirectory;
property IncludeDirectory : Boolean
read GetIncludeDirectory write SetIncludeDirectory
default DefIncludeDirectory;
property RTSLowForWrite : Boolean
read GetRTSLowForWrite write SetRTSLowForWrite
default DefRTSLowForWrite;
property AbortNoCarrier : Boolean
read GetAbortNoCarrier write SetAbortNoCarrier
default DefAbortNoCarrier;
property BP2KTransmit : Boolean
read GetBP2KTransmit write SetBP2KTransmit
default DefBP2KTransmit;
property AsciiSuppressCtrlZ : Boolean
read GetAsciiSuppressCtrlZ write SetAsciiSuppressCtrlZ
default DefAsciiSuppressCtrlZ;
{Read only properties}
property Batch : Boolean
read GetBatch;
property BlockLength : Word
read GetBlockLength;
property BlockNumber : Word
read GetBlockNumber;
property ProtocolStatus : Word
read GetProtocolStatus;
property ProtocolError : SmallInt
read GetProtocolError;
property FileLength : LongInt
read GetFileLength;
property FileDate : TDateTime
read GetFileDate;
property InitialPosition : LongInt
read GetInitialPosition;
{Status properties}
property StatusDisplay : TApdAbstractStatus
read FStatusDisplay write SetStatusDisplay;
property ProtocolLog : TApdProtocolLog
read FProtocolLog write SetProtocolLog;
property StatusInterval : Word
read GetStatusInterval write SetStatusInterval default DefStatusInterval;
property InProgress : Boolean
read GetInProgress;
property BlockErrors : Word
read GetBlockErrors;
property TotalErrors : Word
read GetTotalErrors;
property BytesRemaining : LongInt
read GetBytesRemaining;
property BytesTransferred : LongInt
read GetBytesTransferred;
property ElapsedTicks : LongInt
read GetElapsedTicks;
property FileName : String
read GetFileName write SetFileName;
{Xmodem/Ymodem properties}
property XYmodemBlockWait : Word
read GetXYmodemBlockWait write SetXYmodemBlockWait
default DefXYmodemBlockWait;
{Zmodem properties}
property ZmodemOptionOverride : Boolean
read GetZmodemOptionOverride write SetZmodemOptionOverride
default DefZmodemOptionOverride;
property ZmodemSkipNoFile : Boolean
read GetZmodemSkipNoFile write SetZmodemSkipNoFile
default DefZmodemSkipNoFile;
property ZmodemFileOption : TZmodemFileOptions
read GetZmodemFileOption write SetZmodemFileOption
default DefZmodemFileOption;
property ZmodemRecover : Boolean
read GetZmodemRecover write SetZmodemRecover default DefZmodemRecover;
property Zmodem8K : Boolean
read GetZmodem8K write SetZmodem8K default DefZmodem8K;
property ZmodemFinishRetry : Word
read GetZmodemFinishRetry write SetZmodemFinishRetry
default DefZmodemFinishRetry;
{Kermit properties}
property KermitMaxLen : Word
read GetKermitMaxLen write setKermitMaxLen
default DefKermitMaxLen;
property KermitMaxWindows : Word
read GetKermitMaxWindows write SetKermitMaxWindows
default DefKermitMaxWindows;
property KermitSWCTurnDelay : Word
read GetKermitSWCTurnDelay write SetKermitSWCTurnDelay
default DefKermitSWCTurnDelay;
property KermitTimeoutSecs : Word
read GetKermitTimeoutSecs write SetKermitTimeoutSecs
default DefKermitTimeoutSecs;
property KermitPadCharacter : Char
read GetKermitPadCharacter write SetKermitPadCharacter
default DefKermitPadCharacter;
property KermitPadCount : Word
read GetKermitPadCount write SetKermitPadCount
default DefKermitPadCount;
property KermitTerminator : Char
read GetKermitTerminator write SetKermitTerminator
default DefKermitTerminator;
property KermitCtlPrefix : Char
read GetKermitCtlPrefix write SetKermitCtlPrefix
default DefKermitCtlPrefix;
property KermitHighbitPrefix : Char
read GetKermitHighbitPrefix write SetKermitHighbitPrefix
default DefKermitHighbitPrefix;
property KermitRepeatPrefix : Char
read GetKermitRepeatPrefix write SetKermitRepeatPrefix
default DefKermitRepeatPrefix;
property KermitWindowsTotal : Word
read GetKermitWindowsTotal;
property KermitWindowsUsed : Word
read GetKermitWindowsUsed;
property KermitLongBlocks : Boolean
read GetKermitLongBlocks;
property AsciiCharDelay : Word
read GetAsciiCharDelay write SetAsciiCharDelay
default DefAsciiCharDelay;
property AsciiLineDelay : Word
read GetAsciiLineDelay write SetAsciiLineDelay
default DefAsciiLineDelay;
property AsciiEOLChar : Char
read GetAsciiEOLChar write SetAsciiEOLChar
default DefAsciiEOLChar;
property AsciiCRTranslation : TAsciiEOLTranslation
read GetAsciiCRTranslation write SetAsciiCRTranslation
default DefAsciiCRTranslation;
property AsciiLFTranslation : TAsciiEOLTranslation
read GetAsciiLFTranslation write SetAsciiLFTranslation
default DefAsciiLFTranslation;
property AsciiEOFTimeout : Word
read GetAsciiEOFTimeout write SetAsciiEOFTimeout
default DefAsciiEOFTimeout;
{Protocol events}
property OnProtocolAccept : TProtocolAcceptEvent
read FOnProtocolAccept write FOnProtocolAccept;
property OnProtocolError : TProtocolErrorEvent
read FOnProtocolError write FOnProtocolError;
property OnProtocolFinish : TProtocolFinishEvent
read FOnProtocolFinish write FOnProtocolFinish;
property OnProtocolLog : TProtocolLogEvent
read FOnProtocolLog write FOnProtocolLog;
property OnProtocolNextFile : TProtocolNextFileEvent
read FOnProtocolNextFile write FOnProtocolNextFile;
property OnProtocolResume : TProtocolResumeEvent
read FOnProtocolResume write FOnProtocolResume;
property OnProtocolStatus : TProtocolStatusEvent
read FOnProtocolStatus write FOnProtocolStatus;
end;
{Protocol component}
TApdProtocol = class(TApdCustomProtocol)
published
property ComPort;
property ProtocolType;
property DestinationDirectory;
property FileMask;
property BlockCheckMethod;
property HandshakeRetry;
property HandshakeWait;
property TransmitTimeout;
property FinishWait;
property TurnDelay;
property Overhead;
property WriteFailAction;
property HonorDirectory;
property IncludeDirectory;
property RTSLowForWrite;
property AbortNoCarrier;
property BP2KTransmit;
property AsciiSuppressCtrlZ;
property StatusDisplay;
property ProtocolLog;
property StatusInterval;
property FileName;
property XYmodemBlockWait;
property ZmodemOptionOverride;
property ZmodemSkipNoFile;
property ZmodemFileOption;
property ZmodemRecover;
property Zmodem8K;
property ZmodemFinishRetry;
property KermitMaxLen;
property KermitMaxWindows;
property KermitSWCTurnDelay;
property KermitTimeoutSecs;
property KermitPadCharacter;
property KermitPadCount;
property KermitTerminator;
property KermitCtlPrefix;
property KermitHighbitPrefix;
property KermitRepeatPrefix;
property AsciiCharDelay;
property AsciiLineDelay;
property AsciiEOLChar;
property AsciiCRTranslation;
property AsciiLFTranslation;
property AsciiEOFTimeout;
property OnProtocolAccept;
property OnProtocolError;
property OnProtocolFinish;
property OnProtocolLog;
property OnProtocolNextFile;
property OnProtocolResume;
property OnProtocolStatus;
end;
{.Z+}
{A list of active TApdProtocol objects}
PProtocolWindowNode = ^TProtocolWindowNode;
TProtocolWindowNode = record
pwWindow : HWnd;
pwProtocol : TApdCustomProtocol;
end;
{Miscellaneous functions}
function CheckNameString(const Check : TBlockCheckMethod) : String;
function FormatMinSec(const TotalSecs : LongInt) : String;
{.Z-}
function ProtocolName(const ProtocolType : TProtocolType) : String;
{Component registration procedure}
procedure Register;